package com.ms.es.result.impl;

import com.ms.common.exception.ESQueryException;
import com.ms.common.utils.GsonUtil;
import com.ms.es.result.EsQueryResult;
import com.ms.es.result.EsResultHandler;

public abstract class BaseResultHandler implements EsResultHandler {

    @Override
    public EsQueryResult handlerToEsResult(String result) {
        try {
            return GsonUtil.str2Object(result, EsQueryResult.class);
        } catch (Exception e) {
            throw new ESQueryException(result, e);
        }
    }

}